#include "bullet.h"
#include<QPixmap>
#include<QGraphicsScene>
#include"config.h"
Bullet::Bullet(QGraphicsItem *parent):QGraphicsPixmapItem(parent)
{
    setPixmap(QPixmap(":/images/ci.png"));
    this->setScale(0.1);
    startTimer(50);
}


void Bullet::timerEvent(QTimerEvent *)
{
    setPos(x()+15,y());
    if(x()>SW+boundingRect().width()*PS){
        scene()->removeItem(this);
        delete this;
    }
}
